package com.nuoniu.sibanyun.mapper.work;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.work.WorkReportUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-09-09
 */
public interface WorkReportUserMapper extends BaseMapper<WorkReportUser> {

    @Select("select * from oa_submit_record where office_id = #{officeId} and work_type = #{workType}")
    List<WorkReportUser> getByOfficeId(Integer officeId, Integer workType);

    @Delete("delete from oa_submit_record where office_id = #{officeId} and work_type = #{workType}")
    void deleteByOffice(Integer officeId, Integer workType);

    @Select("select * from oa_submit_record where office_id=#{officeId} and type=#{type} and work_type=#{workType}")
    WorkReportUser getDetail(Integer officeId, Integer type, Integer workType);
}
